package com.sky.mq.producer;


import com.sky.event.DishEvent;
import com.sky.message.DishMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;


/**
 * 菜品MQ提供者
 */
@Component
public class DishProducer {

    @Autowired
    ApplicationEventPublisher applicationEventPublisher;

    public void send(Long id,String name,Long type){
        DishEvent dishEvent = new DishEvent(new DishMessage(id,name,type));
        applicationEventPublisher.publishEvent(dishEvent);
    }

}
